package self.Lunastic.HexaSweeper.Object;

import self.Lunastic.HexaSweeper.Unit.ButtonCeil;

import java.util.ArrayList;

/**
 * 格子对象
 */
public class GameCeil {
    // 是否为格子  （在创建格子的时候就确定）
    private final boolean _isCeil;
    public boolean isCeil() { return this._isCeil; }

    // 是否被翻开
    private boolean _cover = true;
    public boolean isCover() { return _cover; }
    public void discover(){ this._cover = false; this._flag = false; }

    // 是否被标记
    private boolean _flag = false;
    public boolean isFlag() { return _flag; }
    public void setFlag() { this._flag = true; }
    public void removeFlag() { this._flag = false; }

    // 是否被点击
    private boolean _click;
    public boolean isClick() { return _click; }
    public void press(){ this._click = true; }
    public void release(){ this._click = false; }

    // 和按钮连接
    public ButtonCeil buttonCeil;

    // 基础属性
    public int x, y, r;

    /**
     * <b>type</b>: 用于给格子的特殊标识<br>
     *  <ul><li>-2: 未标识（默认）</li><li>-1: 雷区</li><li>0~6: 数字显示</li><ul/>
     */
    private  int _type = -2;
    public int getType() { return _type; }
    public void setType(int type) { this._type = type; }

    // 指向相邻格子对象
    public ArrayList<GameCeil> aroundCeil = new ArrayList<>();

    // 构造
    public GameCeil(int x, int y, int r, boolean isCeil){
        this.x = x;this.y = y;this.r = r;
        this._isCeil = isCeil;
    }
}
